from typing import List
class Solution:
    def minimumOperations(self, nums: List[int]) -> int:
        ans = 0
        for i in nums:
            ans+=min(abs(3-i%3),i%3-0)
        return ans
        